package com.njbw.book.facade.fund;

import com.njbw.book.facade.unFund.*;

/**
 * 基金类
 * 它需要了解所有的股票或其它投资方式的方法或属性，进行组合，以备外界调用
 *
 * @author 黄侯淳
 * @since JDK 1.8
 */
public class Fund {

    private final Stock1 stock1;
    private final Stock2 stock2;
    private final Stock3 stock3;
    private final Realty realty;
    private final NationalDebt nationalDebt;

    public Fund() {
        stock1 = new Stock1();
        stock2 = new Stock2();
        stock3 = new Stock3();
        realty = new Realty();
        nationalDebt = new NationalDebt();
    }

    // 买基金
    public void buyFund() {
        System.out.println("基金买入");
        stock1.buy();
        stock2.buy();
        stock3.buy();
        realty.buy();
        nationalDebt.buy();
    }

    // 卖基金
    public void sellFund() {
        System.out.println("基金卖出");
        stock1.sell();
        stock2.sell();
        stock3.sell();
        realty.sell();
        nationalDebt.sell();
    }
}
